package com.yjc.dp;

import java.util.Arrays;

/**
 * 1137. 第 N 个泰波那契数
 *
 * @author yjc
 * @create 2024-07-18 15:12
 */
public class Subject_3 {
    public static void main(String[] args) {
        int n = 25;

        int[] dp = new int[n + 1];

        for (int i = 0; i <= n; i++) {
            if (i <= 2) {
                switch (i) {
                    case 0:
                        dp[i] = 0;
                        break;
                    case 1:
                    case 2:
                        dp[i] = 1;
                        break;
                }
            } else {
                dp[i] = dp[i - 3] + dp[i - 2] + dp[i - 1];
            }
        }
        System.out.println(dp[n]);

    }
}
